home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / 2d_smooth_fade / 2d_smooth_fade.dba next >
Encoding:
Text File  |  2001-02-05  |  1.2 KB  |  62 lines

  1. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2. `         Smooth 2D Screen Fade
  3. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4. ` By Rich Davey (rich@fatal-design.com)
  5. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  6. ` Music listened  to while  coding this
  7. ` Euphoria Level 4 (CD2)
  8. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  9. ` Note:
  10. `
  11. ` Coded in response to a plea in the DB
  12. ` forum, doesn't need 3D switching!!!
  13.  
  14. sync rate 0
  15. sync on
  16. hide mouse
  17.  
  18. center text 320,240,"Please Wait..."
  19.  
  20. `    Change this BMP for any 640x480 bitmap
  21.  
  22. load bitmap "fadepic4.bmp",1
  23.  
  24. `    s=the delay between each fade frame (30=slow, 10=fast)
  25. `    Change the step minus value to control the total number of frames.
  26. `    The higher the value, the faster the initial calculation.
  27. `    Good value is -10 or -5. (10=faster, 5=smoother)
  28. `    Be advised the more frames the more memory taken up!
  29.  
  30. i=1 : s=25
  31.  
  32. for a=100 to 0 step -5
  33.  
  34.     get image i,0,0,640,480
  35.     fade bitmap 1,a
  36.     inc i
  37.  
  38. next a
  39.  
  40. set current bitmap 0
  41.  
  42. `    Fade it... in and then out, ad infinitum
  43.  
  44. do
  45.  
  46.     for a=i-1 to 1 step -1
  47.         paste image a,0,0
  48.         sleep s
  49.         sync
  50.     next a
  51.  
  52.     sleep 4000
  53.  
  54.     for a=1 to i-1
  55.         paste image a,0,0
  56.         sleep s
  57.         sync
  58.     next a
  59.  
  60. loop
  61.  
  62.